<template>
  <view class="container">
    <!-- 顶部奖金信息卡 -->
    <view class="bonus-card">
      <view class="bonus-info">
		<text class="amount-desc">可提现金额</text>
        <text class="amount">{{ agent.money }}</text>
      </view>
      <view class="bonus-details">
        <view class="detail-item">
          <text class="icon">💰</text>
          <text class="detail-text">总奖励 {{ agent.total_money }}</text>
        </view>
		<!--
        <view class="detail-item">
          <text class="icon">⏳</text>
          <text class="detail-text">冻结中 {{ agent.freeze_money }}</text>
        </view>
		-->
      </view>
      <button class="withdraw-button" @click="gotoCash">提现</button>
    </view>

    <!-- 列表项 -->
    <view class="list">
      <view class="list-item" hover-class="list-item-hover" @click="gotoPage('/pages/agent/number_transfer/number_transfer')">
        <text>同账号互转</text>
        <view class="arrow">></view>
      </view>
      <view class="list-item" hover-class="list-item-hover" @click="gotoPage('/pages/agent/bonus_beans/bonus_beans')" >
        <text>奖金转蜜豆</text>
        <view class="arrow">></view>
      </view>
      <view class="list-item" hover-class="list-item-hover" @click="gotoPage('/pages/agent/income_detail/income_detail')">
        <text>奖金明细</text>
        <view class="arrow">></view>
      </view>
      <view class="list-item" hover-class="list-item-hover" @click="gotoPage('pages/agent/cash/list/list')">
        <text>提现明细</text>
        <view class="arrow">></view>
      </view>
      <view class="list-item" hover-class="list-item-hover" @click="gotoPage('/pages/agent/transfer_details/transfer_details')" v-if="is_store_user==0">
        <text>转账明细</text>
        <view class="arrow">></view>
      </view>
      <view class="list-item" hover-class="list-item-hover" @click="gotoPage('/pages/agent/transfer_bean_details/transfer_bean_details')" v-if="is_store_user==0">
        <text>转豆记录</text>
        <view class="arrow">></view>
      </view>
	  <view class="list-item" hover-class="list-item-hover" @click="gotoPage('/pages/agent/bank/bank')">
	    <text>提现银行卡</text>
	    <view class="arrow">></view>
	  </view>
	  
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
		is_agent : {},
		top_background : {},
		agent : {},
		user : {},
		isData : false,
		loadding : false,
		is_store_user:0,
	};
  },
  onShow() {
  	uni.showLoading({
  		title: '加载中'
  	});
  	/*获取个人中心数据*/
  	this.getData();
  },
  methods: {
  	/*获取数据*/
  	getData() {
  		let self = this;
  		self._get('user.agent/center', {}, function(data) {
  			self.info_words = data.data.words;
  			//self.titel = data.data.words.index.title.value;
  			self.is_agent = data.data.is_agent;
  			self.top_background = data.data.background;
  			self.agent = data.data.agent;
  			self.user = data.data.user;
  			self.isData = true;
  			self.loadding = false;
			self.is_store_user = data.data.is_store_user;
  			uni.hideLoading();
  		});
  	},
	/*去提现*/
	gotoCash() {
		this.gotoPage('/pages/agent/cash/apply/apply');
	},
	goback() {
		uni.navigateBack();
	}
}
};
</script>

<style>
/* 整体容器 */
.container {
  background-color: #f5f5f5;
  height: 100%;
}

/* 奖金卡片样式 */
.bonus-card {
  background: linear-gradient(to right, #d7b6ff, #f0e8ff);
  border-radius: 10px;
  padding: 20rpx;
  position: relative;
}

.bonus-info {
  margin-bottom: 20rpx;
  padding: 0 40rpx;
}

.amount {
  font-size: 48rpx;
  color: #000;
  font-weight: bold;
  display: block;
}

.amount-desc {
  font-size: 24rpx;
  color: #666;
}

.bonus-details {
  display: flex;
  justify-content: space-between;
  padding: 0 40rpx;
  margin-bottom: 20rpx;
}

.detail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.icon {
  font-size: 36rpx;
  margin-bottom: 10rpx;
}

.detail-text {
  font-size: 22rpx;
  color: #333;
}

.withdraw-button {
  position: absolute;
  top: 20rpx;
  right: 20rpx;
  background-color: #ffffff;
  color: red;
  border: 1rpx solid #9b59b6;
  border-radius: 20rpx;
  font-size: 22rpx;
  width: 200rpx;
  padding: 10rpx;
}

/* 列表样式 */
.list {
  margin-top: 20rpx;
  background-color: #ffffff;
  border-radius: 10px;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1rpx solid #f0f0f0;
  font-size: 16px;
  color: #333;
}

.list-item:last-child {
  border-bottom: none;
}

.arrow {
  font-size: 28rpx;
  color: #999;
}

.list-item-hover {
  background-color: #f7f7f7;
}
</style>